PROGRAM main
  VAR
    // 启动按钮
    bStartButton AT %IX0.0 : BOOL;
    // 停止按钮
    bStopButton AT %IX0.1 : BOOL;
    // 电机控制输出
    bMotorSwitch AT %QX0.0 : BOOL;
  END_VAR

bMotorSwitch := (bStartButton OR bMotorSwitch) AND NOT bStopButton;
END_PROGRAM
